using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace RideMe.Presentation
{
    public partial class GeneratorDialog : DialogBase 
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="T:GeneratorDialog"/> class.
        /// </summary>
        public GeneratorDialog()
        {
            InitializeComponent();
        }

        private string _commandName;

        /// <summary>
        /// Gets or sets the name of the command.
        /// </summary>
        /// <value>The name of the command.</value>
        public string CommandName
        {
            get { return _commandName; }
            set 
            {
                _commandName = value;

                this.Text = value;
            }
        }

        /// <summary>
        /// Gets or sets the usage label.
        /// </summary>
        /// <value>The usage label.</value>
        public string UsageLabel
        {
            get { return usageHeader.Caption; }
            set { usageHeader.Caption = value; }
        }

        /// <summary>
        /// Gets or sets the generator command.
        /// </summary>
        /// <value>The generator command.</value>
        public string GeneratorCommand
        {
            get { return commandTextBox.Text; }
            set { commandTextBox.Text = value; }
        }

        /// <summary>
        /// Handles the Click event of the okButton control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
        private void okButton_Click(object sender, EventArgs e)
        {
            if (commandTextBox.Text.Trim().Length == 0) return;

            DialogResult = DialogResult.OK;
        }
    }
}